<?php
use think\Cookie;
use think\Db;

//验证是否登陆
function checkSign()
{
    return Cookie::has('number');
}

function getCookie()
{
    return Cookie::get('number');
}

function getUserId()
{
    $user_id = Db::table('user')->field(['user_id'])->where('number', getCookie())->select();
    return $user_id[0]['user_id'];
}

function getId($number)
{
    $user_id = Db::table('user')->field(['user_id'])->where('number', $number)->select();
    return $user_id[0]['user_id'];
}

//过滤回调函数 已选择
function flterOne($el)
{
    if ($el == 0) {
        return false;
    } else {
        return true;
    }
}

//过滤回调函数 未选择
function unFlterOne($el)
{
    if ($el == 0) {
        return true;
    } else {
        return false;
    }
}
